****set the working directory for your computer
cd "C:\Users\trounsj\Box\Research\Political_Inequality\PSRM"

use "PSRM_landuse.dta", clear
quietly regress E_bg_multi averesid_maxduaRE_bg presid_multifam_bg
sum averesid_maxduaRE_bg  presid_multifam_bg al1he001_bg E_bg_multi pwht_bg prenter_bg pbelowpov_bg if e(sample)
sum averesid_maxduaRE_bg presid_multifam_bg if e(sample), detail

regress al1he001_bg averesid_maxduaRE_bg presid_multifam_bg i.jurisdiction_n, vce(robust)
margins, at(averesid_maxduaRE_bg=.006 presid_multifam_bg = 0)
margins, at(averesid_maxduaRE_bg=.114 presid_multifam_bg =1)


regress pwht_bg averesid_maxduaRE_bg presid_multifam_bg i.jurisdiction_n, vce(robust)
margins, at(averesid_maxduaRE_bg=.006 presid_multifam_bg = 0)
margins, at(averesid_maxduaRE_bg=.114 presid_multifam_bg =1)



regress E_bg_multi averesid_maxduaRE_bg presid_multifam_bg i.jurisdiction_n, vce(robust)
margins, at(averesid_maxduaRE_bg=.006 presid_multifam_bg = 0)
margins, at(averesid_maxduaRE_bg=.114 presid_multifam_bg =1)

regress prenter_bg averesid_maxduaRE_bg presid_multifam_bg i.jurisdiction_n, vce(robust)
margins, at(averesid_maxduaRE_bg=.006 presid_multifam_bg = 0)
margins, at(averesid_maxduaRE_bg=.114 presid_multifam_bg =1)

regress pbelowpov_bg averesid_maxduaRE_bg presid_multifam_bg i.jurisdiction_n, vce(robust)
margins, at(averesid_maxduaRE_bg=.006 presid_multifam_bg = 0)
margins, at(averesid_maxduaRE_bg=.114 presid_multifam_bg =1)

use "PSRM_zoningseg.dta", clear

tabstat H_metrocity_SFZ H_metrowithin_SFZ H_metrotract_SFZ, by(fips_n)

